namespace net.podhola.gtd.finances

import System
import net.podhola
import net.podhola.gtd

[Castle.ActiveRecord.ActiveRecord]
class Balance(Castle.ActiveRecord.ActiveRecordBase of Balance):
	_id as int	
	[Castle.ActiveRecord.PrimaryKey(Castle.ActiveRecord.PrimaryKeyType.Increment)]
	Id as int:
		get: return _id
		set: _id = value

	_balancedOn as DateTime
	[Castle.ActiveRecord.Property] 
	BalancedOn as DateTime:
		get: return _balancedOn
		set: _balancedOn = value

	_onAccount as Account
	[Castle.ActiveRecord.BelongsTo("accountid")]
	OnAccount as Account:
		get: return _onAccount
		set:
			_onAccount = value
			_onAccount.Balances.Add( self )

	_amount as double
	[Castle.ActiveRecord.Property] 
	Amount as double:
		get: return _amount
		set: _amount = value
